cet: Make a simple copy when source and target are in UTF-8.
authoroliskoli <oliskoli>
Tue, 20 Feb 2007 19:40:52 +0000 (19:40 +0000)
committeroliskoli <oliskoli>
Tue, 20 Feb 2007 19:40:52 +0000 (19:40 +0000)
cet.c

diff --git a/cet.c b/cet.c
index abc8b64b69108f2bca72491fd8ae61d313819cef..99a99a4f288af3b5311a3841761a6eff593e8698 100644 (file)
--- a/cet.c
+++ b/cet.c
@@ -305,6 +305,7 @@ cet_str_any_to_utf8(const char *src, const cet_cs_vec_t *vec)
 
        cin = (char *)src;
        if (cin == NULL) return NULL;
+       if (vec->ucs4_count == 0) return xstrdup(src); /* UTF-8 -> UTF-8 */
 
        len = 0;
        while (*cin != '\0')            /* determine length of resulting UTF-8 string */